from selenium import webdriver
import json

web = webdriver.Chrome(executable_path='chromedriver.exe')
web.get('https://www.bilibili.com')

f = open('cookie1.txt', 'r')
list_cookie = json.loads(f.read())  # 读取文件中的cookies数据
print(f.read())
for cookie in list_cookie:
    web.add_cookie(cookie)  # 将cookies数据添加到浏览器
web.refresh()  # 刷新网页
